home *** CD-ROM | disk | FTP | other *** search
- Writing a module for MBlank is quite simple. Your code must perform a few
- basic functions but the rest is up to you.
-
- 1. When your module is run it must create a public message port with the
- name "MBlank" and then wait for messages from MultiBlank. MultiBlank uses
- the creation of the port as an indicator that everything went well and
- that the module is ready to go.
-
- 2. MultiBlank trys to keep it's messages coherent but this is not guaranteed
- so I suggest that variables set in the "blanking" procedure are unset in
- that "clearing" procedure, e.g. screen pointers, and tested for validity
- before use.
-
- 3. Names for pref files should be derived from the program name returned by
- DOS's GetProgramName (). This is because the user might want several
- copies of your module with different settings, e.g. my execution module.
-
- 4. If your blanking procedure uses a loop then check for signals from the
- port as often as possible using SetSignal () and try to respond quickly.
-
- 5. You should also check for SIGBREAKF_CTRL_C so that a module can be stopped
- if run from a CLI by accident.
-
- The messages you will recieve are as follows:
-
- MBMT_INIT - initiate any resources your module requires. Doing it this way
- provides for easier interaction with MultiBlank. Set the
- "success" field to TRUE or FALSE depending on success and the
- "flags" field depending on availablity of the info and config
- functions. If the module fails you will be sent a MBMT_QUIT
- message straight away. This is why varibles should always be
- set and cleared.
-
- MBMT_BLANK - start the blanking procedure. Allocate anything needed temp.
- like screens and windows. Set the "success" field.
-
- MBMT_CLEAR - unblank the screen. Deallocate anything allocated in the
- blanking procedure.
-
- MBMT_INFO - put the module information requester up. The message contains
- pointers to MultiBlank's screen and window. The requester
- should use these as in the example. Again, the "success" field
- requires setting before you Reply (). On failure MultiBlank
- puts it's own requester up. The requesters title should be
- "Module Information"
-
- MBMT_CONFIG - put up the module config window. Much like MBMT_INFO but you
- will probably be using a window of you own, not a requester.
- Use the screen and window fields to centre your window on
- MultiBlank's. "success" requires setting. The title is up to
- you but I suggest the module's real name (not the one from
- GetProgramName ()).
-
- MBMT_QUIT - Deallocate resources allocated in MBMT_INIT and remove message
- port then quit.
-
- When it's finished copy it to your module directory with the extention
- ".mbmod"
-
- To program a safe module use the philosophy of "check everything". Your
- module will not be sent MBMT_INFO or MBMT_CONFIG unless you set the "flags"
- field in the MBMT_INIT message accordingly.
-
- The example code and include file should answer any questions, but I have an
- email address if you need more help.
-
- Simon